<?php
require_once 'lib/controllerWithoutGetOrPost.php';
require_once '../models/EmailModel.php';
if (!empty($_POST['submit'])) {
    $email = new EmailModel();
    $email->setToName($_POST['toName']);
    $email->setToEmail($_POST['toEmail']);
    $email->setFromName($_POST['fromName']);
    $email->setFromEmail($_POST['fromEmail']);
    $email->setSubject($_POST['subject']);
    $email->setMessage($_POST['message']);
    $email->send();
}
$self = $_SERVER['PHP_SELF'];
echo <<< EOT
    <h1>Send Email</h1>
    <form method="POST" action="$self">
        <p>
            <label>To Name:</label>
            <input type="text" name="toName">
        </p>
        <p>
            <label>To Email:</label>
            <input type="text" name="toEmail">
        </p>
        <p>
            <label>From Name:</label>
            <input type="text" name="fromName">
        </p>
        <p>
            <label>From Email:</label>
            <input type="text" name="fromEmail">
        </p>
        <p>
            <label>Subject:</label>
            <input type="text" name="subject">
        </p>
        <p>
            <label>Message:</label>
            <textarea name="message" cols="40" rows="15"></textarea>
        </p>
        <p>
            <input type="submit" name="submit" value="Submit">
        </p>
    </form>
EOT;
$messages = array();
$messages[] = <<< EOT
<h3>Notice Summary for <a href="/remembrance.php?personid=39387" style="color: #c12a0b">Patricia Violet Reid</a></h3> 
<p style="margin-top: -1.5em; font-size: smaller">Prepared 13 July 2009 <a href="http://www.amemorytree.co.nz/" style="color: #c12a0b">www.amemorytree.co.nz</a></p> 
<dl style="margin: 0.5em 0"> 
    <dt style="float: left">ID</dt><dd style="margin-left: 11em; line-height: 1.5">39387</dd> 
    <dt style="float: left">Remembrance Page</dt><dd style="margin-left: 11em; line-height: 1.5"><a href="/remembrance.php?personid=39387" style="color: #c12a0b">direct link</a></dd> 
    <dt style="float: left">Last Name</dt><dd style="margin-left: 11em; line-height: 1.5">Reid</dd> 
    <dt style="float: left">First Name</dt><dd style="margin-left: 11em; line-height: 1.5">Patricia Violet</dd> 
    <dt style="float: left">Also Known as</dt><dd style="margin-left: 11em; line-height: 1.5">Trish</dd> 
    <dt style="float: left">Nee Name</dt><dd style="margin-left: 11em; line-height: 1.5">SAVILL</dd> 
    <dt style="float: left">Former Name/s</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Death Date</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Birth Date</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Age</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown </dd> 
    <dt style="float: left">Country</dt><dd style="margin-left: 11em; line-height: 1.5">New Zealand</dd> 
    <dt style="float: left">City/Town</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Former City/Town</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Charity</dt><dd style="margin-left: 11em; line-height: 1.5">Hospice - Waipuna </dd> 
    <dt style="float: left">Funeral Home</dt><dd style="margin-left: 11em; line-height: 1.5">Legacy Funerals</dd> 

</dl> 
<div class="newspaper"> 
<h4><a href="http://www.nzherald.co.nz/" style="color: #c12a0b">NZ Herald</a></h4> 
<p>29 May 2008<br>30 May 2008</p> 
<p>Reid, Patricia Violet<br>
<br>
Wife of Vic Reid (late)<br>
Mother & Mother-in-law of Shayne, Sharon & Kerry Wright, Andrew & Jolene, Rachel.<br>
Only sister & sister-in-law of Edward & Joy, David & Helen, Stuart & Keiran.<br>
Grandmother of Amy, Lona and Andre<br>
Service . 14th Ave Gospel Centre, cnr 14th Ave and Burrows Street, Tauranga. Friday 30th May 1.30pm.<br>
Buriel . Pyes Pa Cemetery<br>
<br>
Communciation . C/ PO Box 8139, Tauranga</p> 
</div> 

EOT;
$messages[] = <<< EOT
<h3>Notice Summary for <a href="/remembrance.php?personid=23436" style="color: #c12a0b">Keith Ross Tait</a></h3> 
<p style="margin-top: -1.5em; font-size: smaller">Prepared 17 July 2009 <a href="http://www.amemorytree.co.nz/" style="color: #c12a0b">www.amemorytree.co.nz</a></p> 
<dl style="margin: 0.5em 0"> 
    <dt style="float: left">ID</dt><dd style="margin-left: 11em; line-height: 1.5">23436</dd> 
    <dt style="float: left">Remembrance Page</dt><dd style="margin-left: 11em; line-height: 1.5"><a href="/remembrance.php?personid=23436" style="color: #c12a0b">direct link</a></dd> 
    <dt style="float: left">Last Name</dt><dd style="margin-left: 11em; line-height: 1.5">Tait</dd> 
    <dt style="float: left">First Name</dt><dd style="margin-left: 11em; line-height: 1.5">Keith Ross</dd> 
    <dt style="float: left">Also Known as</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Nee Name</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Former Name/s</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Death Date</dt><dd style="margin-left: 11em; line-height: 1.5">2007-09-24 00:00:00</dd> 
    <dt style="float: left">Birth Date</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Age</dt><dd style="margin-left: 11em; line-height: 1.5">80 years</dd> 
    <dt style="float: left">Country</dt><dd style="margin-left: 11em; line-height: 1.5">New Zealand</dd> 
    <dt style="float: left">City/Town</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Former City/Town</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Charity</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Funeral Home</dt><dd style="margin-left: 11em; line-height: 1.5">Central Hawkes Bay Funeral Services Ltd</dd> 
</dl>
<div class="newspaper"> 
    <h4><a href="http://www.stuff.co.nz/manawatu-standard/" style="color: #c12a0b">Manawatu Standard</a></h4> 
    <p>25 September 2007</p> 
    <p>Tait, Keith Ross<br>
<br>
Died at Mt Herbert House, Waipukurau<br>
Husband of Gladys<br>
Brother of Noeline Gregg . Palmerston North<br>
Twin brother of Ian (deceased)<br>
Service . Stonehaven, 10 Peel At, Waipukurau.  Wednesday 26th September 2007.<br>
Private Cremation</p>
</div>

EOT;
$messages[] = <<< EOT
<h3>Notice Summary for <a href="/remembrance.php?personid=58470" style="color: #c12a0b">Noeline Strachan Gregg</a></h3> 
<p style="margin-top: -1.5em; font-size: smaller">Prepared 17 July 2009 <a href="http://www.amemorytree.co.nz/" style="color: #c12a0b">www.amemorytree.co.nz</a></p> 
<dl style="margin: 0.5em 0"> 
    <dt style="float: left">ID</dt><dd style="margin-left: 11em; line-height: 1.5">58470</dd> 
    <dt style="float: left">Remembrance Page</dt><dd style="margin-left: 11em; line-height: 1.5"><a href="/remembrance.php?personid=58470" style="color: #c12a0b">direct link</a></dd> 
    <dt style="float: left">Last Name</dt><dd style="margin-left: 11em; line-height: 1.5">Gregg</dd> 
    <dt style="float: left">First Name</dt><dd style="margin-left: 11em; line-height: 1.5">Noeline Strachan</dd> 
    <dt style="float: left">Also Known as</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Nee Name</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Former Name/s</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Death Date</dt><dd style="margin-left: 11em; line-height: 1.5">01 December 2008</dd> 
    <dt style="float: left">Birth Date</dt><dd style="margin-left: 11em; line-height: 1.5">Unknown</dd> 
    <dt style="float: left">Age</dt><dd style="margin-left: 11em; line-height: 1.5">84 years</dd> 
    <dt style="float: left">Country</dt><dd style="margin-left: 11em; line-height: 1.5">New Zealand</dd> 
    <dt style="float: left">City/Town</dt><dd style="margin-left: 11em; line-height: 1.5">Dannevirke</dd> 
    <dt style="float: left">Former City/Town</dt><dd style="margin-left: 11em; line-height: 1.5">Dannevirke</dd> 
    <dt style="float: left">Charity</dt><dd style="margin-left: 11em; line-height: 1.5">St John - Dannevirke</dd> 
    <dt style="float: left">Funeral Home</dt><dd style="margin-left: 11em; line-height: 1.5">Tararua Funeral Services</dd> 
</dl> 
<div class="newspaper"> 
    <h4><a href="http://www.stuff.co.nz/manawatu-standard/" style="color: #c12a0b">Manawatu Standard</a></h4> 
    <p>02 December 2008<br>03 December 2008</p> 
    <p>Gregg, Noeline Strachan<br>
<br>
Wife of Rob (late)<br>
Mother and Mother-in-law of Janice and Alan James . Masterton. Diane . Napier. Marjorie Leatherland and John Selby.<br>
Grandmother to Gary and Hayley, Karen and Ben, Nicola and Joe, Stephen and Kelly, Joanne and Leith.<br>
Great Grandmother to Maia, Hana and Luke<br>
Messages . Marjorie, 63 Cole Street, Dannevirke<br>
<br>
Service . Knox Church, Swinburn Street, Dannevirke. Thursday 4th December 2008 at 1pm.<br>
Private Cremation</p>
</div> 

EOT;
print_r($messages);
?>
